package com.iskny.framework.config;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jfinal.core.JFinal;
import com.jfinal.handler.Handler;
/**
 * 
 * @author 伟强
 *
 */
public class CommonDataHandler extends Handler {

	private String path = JFinal.me().getContextPath();
	private String pathName = Constants.me().getContextPathName();//默认
	private String jqueryPath = path+"/js/jquery.min.js";
	@Override
	public void handle(String target, HttpServletRequest request,
			HttpServletResponse response, boolean[] isHandled) {
		//参数-上下文名称默认为ctxPath
		request.setAttribute(pathName, path);
//		request.setAttribute("session", request.getSession());
		request.setAttribute("jquery", jqueryPath);
		request.setAttribute("siteUrl", "http://www.iskny.com");
		nextHandler.handle(target, request, response, isHandled);
	}

}
